package com.woniu.micropropertyserver.mapper;

import com.github.pagehelper.PageInfo;
import com.woniu.microcommonsserver.entity.PropertyFaceCheck;
import com.woniu.micropropertyserver.bean.DployPface;
import com.woniu.micropropertyserver.util.PageRest;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.HashMap;
import java.util.List;

/**
 * @author ：zhengbin
 * @date ：Created in 2021/1/28 0028
 * @description：
 * @modified By：
 * @version: $
 */
@Mapper
public interface PropertyFaceMapper {

    List<DployPface> findAll();

    List<DployPface> findByParams(@Param("p") PageRest pageRest, @Param("d") DployPface dployPface);

    int delInfo(Long[] ids);

    int updateAuth(@Param("ids") Long[] ids, @Param("start") Date authorizeStartDate, @Param("end") Date authorizeEndDate, @Param("b") Integer bulid,@Param("now") Date now);

    @Insert("insert into property_face_check(id,fk_emp_id,authorize_status,authorize_start_date,authorize_end_date,face_status)values(null,#{p.fkEmpId},#{p.authorizeStatus},#{p.authorizeStartDate},#{p.authorizeEndDate},#{p.faceStatus})")
    int saveInfo(@Param("p") PropertyFaceCheck propertyFaceCheck);

    @Select("select id,fk_emp_id fkEmpId,authorize_status authorizeStatus,authorize_start_date authorizeStartDate,authorize_end_date authorizeEndDate,face_status faceStatus  from property_face_check where id =#{id}")
    PropertyFaceCheck findOne(Long id);


}
